package com.neusoft.chenhanhua.d0917;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class MapAggregate {
	public static void main(String[] args) {
		t1();
	}
	public static void t1() {
		Map map=new HashMap();
		map.put(1, "梨花1");
		map.put(2, "梨花2");
		map.put(3, "梨花3");
		map.put(4, "梨花4");
		System.out.println(map);
		String s=(String)map.getOrDefault(4, "没有就加");
		System.out.println(map);
		boolean qu=s.equals("没有就加");
		System.out.println(qu);
		for (int i = 0; i < map.size(); i++) {
			System.out.println(map.get(i+1));
			
		}
		Set keySet=map.keySet();
		Iterator it =keySet.iterator() ;
		while (it.hasNext()) {
			Object key=it.next();
			Object value=map.get(key);
			
		}
	}

}
